package com.panshi.service.impl;

import com.panshi.entity.AppCommentT;
import com.panshi.entity.AppSearchT;
import com.panshi.service.CommentClientService;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

@Component
public class CommentClientServiceFallbackFactory implements FallbackFactory<CommentClientService> {
    @Override
    public CommentClientService create(Throwable cause) {
        System.out.println("服务降级--------》");
        return new CommentClientService() {
            @Override
            public Boolean commAdd(AppCommentT appCommentT) {
                return false;
            }

            @Override
            public List<AppCommentT> commZxId(int zxId, int page, int limit) {
                return new ArrayList<>();
            }

            @Override
            public List<AppCommentT> getCommById(int commId) {
                return new ArrayList<>();
            }

            @Override
            public List<AppSearchT> searchPage(int page, int limit, String title) {
                return new ArrayList<>();
            }

            @Override
            public List<AppSearchT> searchNew(int page, int limit) {
                return new ArrayList<>();
            }

            @Override
            public Integer searchCount(String title) {
                return 0;
            }

        };
    }
}
